package br.com.ia.controle;

import br.com.ia.bean.Aresta;
import br.com.ia.bean.Host;
import br.com.ia.bean.Rede;
import java.util.Iterator;

/**
 *
 * @author Jonas Cezar
 */
public class Controle {

    public Controle() {
    }

    public void vereficaRotas(Rede rede) {

        Iterator i = rede.getHosts().keySet().iterator();

        while (i.hasNext()) {

            Host h = (Host) rede.getHosts().get((String) i.next());

            if (h != null) {

                System.out.println(" Host de partida > " + h.getRotulo());

                Iterator j = h.getArestas().iterator();
                while (j.hasNext()) {

                    Aresta a = (Aresta) j.next();

                    System.out.println("  > > " + a.getHost().getRotulo()
                            + " Custo " + a.getCusto());

                }
            }
        }
    }
}
